var config = require("../../config");
var app = getApp();

Page({
  data:{
    orderstatus1: ["邮寄中", "维修中", "维修完成","回寄中" ,"取消订单"],    
    orderstatus2: ["等待到店维修", "维修中", "维修完成","等待取货中","取消订单"],
    
  },
  onLoad(){
   
  },
  onShareAppMessage() {

  },
  onShow(){
    let _this = this;
    wx.getNetworkType({
      success: function (res) {
        if (res.networkType != "none") {
          wx.showLoading({
            title: "加载中...",
            mask: true
          });
          wx.request({
            method: "POST",
            url: config.service.orderList,
            data: {
              uid: wx.getStorageSync("loginInfo").uid,
              logintoken: wx.getStorageSync("loginInfo").token
            },
            header: {
              'content-type': 'application/x-www-form-urlencoded'
            },
            success(res) {
              wx.hideLoading();
              _this.setData({
                status: res.data.code
              });
              if (res.data.code == 1) {
                _this.setData({
                  orderList: res.data.data
                });
              } else {
                wx.showToast({
                  title: res.data.msg,
                  icon: 'loading',
                  mask: true
                });
              }
            }
          });
        } else {
          wx.showToast({
            title: "好像没网了...",
            mask: true
          });
        }
      },
    });
  },
  viewOderDetail(){
    // 统计所点击量
    app.aldstat.sendEvent('查看订单详情', {});
  },
  view(){
    app.aldstat.sendEvent('服务评价', {});
    
  }
});